package com.volvo.caretrack.mobile.actions;

import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.volvo.caretrack.mobile.model.machine.Machine;
import com.volvo.caretrack.mobile.services.MachineManagerService;
import com.volvo.caretrack.mobile.util.ParamUtil;

public class SearchMachineAction extends BaseAction {

	@Override
	public Object loadData(String sessionID, Map params) throws Exception {
		String dealerID = ParamUtil.getParam(params, "dealerID");
		
		List<Machine> list = null;
		if (StringUtils.isNotEmpty(dealerID))
			list = MachineManagerService.getInstance().searchMachineByDealerID(sessionID, dealerID);
		return list;
	}

}
